# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=xsettingsd
pkgver=1.0.2
pkgrel=0
pkgdesc="Configure X11 applications via XSETTINGS specification"
# s390x blocked by too many failing tests and unsupported architecture
arch="all !s390x"
url="https://codeberg.org/derat/xsettingsd"
license="BSD-3-Clause"
makedepends="
	cmake
	gtest-dev
	libx11-dev
	samurai
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/derat/xsettingsd/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "CharStreamTest.Basic"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a2923b4f2201677c5e31a716eb8a27b3f7e9c8cc74fa5ba20f1bb2151c88cbd7152155ad3b7c75ff6c5c1ce2ef162bcb6ccb5332d0d6a58086ff784ba9dbf818  xsettingsd-1.0.2.tar.gz
"
